namespace Collection.Entities {
    	using System;
    	
    	
    	/// <summary>
    	/// 表名：Category 主键列：Id
    	/// </summary>
    	[SerializableAttribute()]
    	public partial class _Category : MySoft.Data.Entity {
    		
    		protected Int32 _Id;
    		
    		protected String _Name;
    		
    		public Int32 Id {
    			get {
    				return this._Id;
    			}
    			set {
    				this.OnPropertyValueChange(_.Id, _Id, value);
    				this._Id = value;
    			}
    		}
    		
    		public String Name {
    			get {
    				return this._Name;
    			}
    			set {
    				this.OnPropertyValueChange(_.Name, _Name, value);
    				this._Name = value;
    			}
    		}
    		
    		/// <summary>
    		/// 获取实体对应的表名
    		/// </summary>
    		protected override MySoft.Data.Table GetTable() {
    			return new MySoft.Data.Table<_Category>("Category");
    		}
    		
    		/// <summary>
    		/// 获取实体中的标识列
    		/// </summary>
    		protected override MySoft.Data.Field GetIdentityField() {
    			return _.Id;
    		}
    		
    		/// <summary>
    		/// 获取实体中的主键列
    		/// </summary>
    		protected override MySoft.Data.Field[] GetPrimaryKeyFields() {
    			return new MySoft.Data.Field[] {
    					_.Id};
    		}
    		
    		/// <summary>
    		/// 获取列信息
    		/// </summary>
    		protected override MySoft.Data.Field[] GetFields() {
    			return new MySoft.Data.Field[] {
    					_.Id,
    					_.Name};
    		}
    		
    		/// <summary>
    		/// 获取列数据
    		/// </summary>
    		protected override object[] GetValues() {
    			return new object[] {
    					this._Id,
    					this._Name};
    		}
    		
    		/// <summary>
    		/// 给当前实体赋值
    		/// </summary>
    		protected override void SetValues(MySoft.Data.IRowReader reader) {
    			if ((false == reader.IsDBNull(_.Id))) {
    				this._Id = reader.GetInt32(_.Id);
    			}
    			if ((false == reader.IsDBNull(_.Name))) {
    				this._Name = reader.GetString(_.Name);
    			}
    		}
    		
    		public override int GetHashCode() {
    			return base.GetHashCode();
    		}
    		
    		public override bool Equals(object obj) {
    			if ((obj == null)) {
    				return false;
    			}
    			if ((false == typeof(_Category).IsAssignableFrom(obj.GetType()))) {
    				return false;
    			}
    			if ((((object)(this)) == ((object)(obj)))) {
    				return true;
    			}
    			return false;
    		}
    		
    		public class _ {
    			
    			/// <summary>
    			/// 表示选择所有列，与*等同
    			/// </summary>
    			public static MySoft.Data.AllField All = new MySoft.Data.AllField<_Category>();
    			
    			/// <summary>
    			/// 字段名：Id - 数据类型：Int32
    			/// </summary>
    			public static MySoft.Data.Field Id = new MySoft.Data.Field<_Category>("Id");
    			
    			/// <summary>
    			/// 字段名：Name - 数据类型：String
    			/// </summary>
    			public static MySoft.Data.Field Name = new MySoft.Data.Field<_Category>("Name");
    		}
    	}
    }
    